export const enum Operation {
  Create = "create",
  Update = "update",
  Delete = "delete",
  View = "view",
  Edit = "edit"
}

export const enum NetState {
  Success = 200,
  Unauthorized = 401
}

// 常见移动设备用户代理关键字
const mobileRegex =
  /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Mobile|mobile|CriOS/i;

export function isMobile() {
  const userAgent = navigator.userAgent || navigator.vendor || window["opera"];

  return mobileRegex.test(userAgent);
}
